using UnityEngine;

public class GlassAddons : MonoBehaviour
{
	[SerializeField]
	private GlassAddonsSelector glassBorderAddonsSelector;

	[SerializeField]
	private GlassAddonsSelector strawAddonsSelector;

	public void SetGlassBorderAddon(int id)
	{
		if (glassBorderAddonsSelector == null)
		{
			glassBorderAddonsSelector = GetAddonSelector("GlassBorderAddon");
		}
		if (glassBorderAddonsSelector != null)
		{
			glassBorderAddonsSelector.SetAddon(id);
		}
	}

	public void SetStrawAddon(int id)
	{
		if (strawAddonsSelector == null)
		{
			strawAddonsSelector = GetAddonSelector("GlassStrawAddon");
		}
		if (strawAddonsSelector != null)
		{
			strawAddonsSelector.SetAddon(id);
		}
	}

	private GlassAddonsSelector GetAddonSelector(string childName)
	{
		Transform transform = base.transform.FindDeepChild(childName);
		if (transform != null)
		{
			return transform.GetComponent<GlassAddonsSelector>();
		}
		return null;
	}
}
